import superRequest from '@/utils/http/index'
import { IDataType } from '@/utils/http/types'

/** 角色列表(接口) */
export const apiRoleCacheList = async () => {
  return await superRequest.get<IDataType>({
    url: '/role/getList'
  })
}

/** 角色查询(接口) */
export const apiRoleList = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/role/list',
    data,
  })
}

/** 角色新增(接口) */
export const apiRoleAdd = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/role/add',
    data,
  })
}

/** 角色修改(接口) */
export const apiRoleUpdate = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/role/update',
    data,
  })
}

/** 角色删除(接口) */
export const apiRoleDelete = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/role/delete',
    data,
  })
}
